<template>

  <div>
    <mt-swipe :auto="4000">
      <mt-swipe-item>1</mt-swipe-item>
      <mt-swipe-item>2</mt-swipe-item>
      <mt-swipe-item>3</mt-swipe-item>
    </mt-swipe>
    <!-- <mt-swipe :auto="4000">
         这里注意：:key不一定偏要绑定给id值，每个url也是唯一的，所以直接给item.url绑定即可 
      <mt-swipe-item v-for="item in lunbotuList" :key='item.url'>
         这里需要用v-bind绑定，否则会当做字符串输出 
          <img :src="item.img" alt="">
      </mt-swipe-item>
      
    </mt-swipe>-->
    <ul class="mui-table-view mui-grid-view mui-grid-9">
      <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
        <a href="#">
          <img src="../images/menu1.png" alt>
          <div class="mui-media-body">新闻资讯</div>
        </a>
      </li>
      <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
        <a href="#">
          <img src="../images/menu2.png" alt>
          <div class="mui-media-body">图片分享</div>
        </a>
      </li>
      <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
        <a href="#">
          <img src="../images/menu3.png" alt>
          <div class="mui-media-body">商品购买</div>
        </a>
      </li>
      <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
        <a href="#">
          <img src="../images/menu4.png" alt>
          <div class="mui-media-body">留言反馈</div>
        </a>
      </li>
      <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
        <a href="#">
          <img src="../images/menu5.png" alt>
          <div class="mui-media-body">视频专区</div>
        </a>
      </li>
      <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
        <a href="#">
          <img src="../images/menu6.png" alt>
          <div class="mui-media-body">联系我们</div>
        </a>
      </li>
    </ul>
  </div>
  
</template>

<script>
// import { Toast } from 'mint-ui'
export default {
  data() {
    return {
      //lunbotuList:[]保存轮播图的数组，使用v-for循环这个数组
    };
  },
  created() {
    //创建完data和methods后调用
    // this.getLunbotu();
    // Toast('获取轮播图图片失败')
  },
  methods: {
    /* getLunbotu() {
        this.$http.get('http://vue.studyit.io/api/getlunbo').then(result=>{
            // console.log(result.body);可以获取到一个对象status=0和一个数组，里面分别是url和img地址。我这里获取不到假装自己可以获取到
            
            if(result.body.status==0){
                this.lunbotuList=result.body.message
            }else {
                Toast('获取轮播图图片失败')
            }
        })
    } */
  }
};
</script>

<style lang="less" scoped>
.mint-swipe {
  height: 200px;
  .mint-swipe-item {
    &:nth-child(1) {
      background-color: red;
    }
    &:nth-child(2) {
      background-color: green;
    }
    &:nth-child(3) {
      background-color: purple;
    }
  }
  .mint-swipe-indicator {
    opacity: 1;
  }
}
.mui-grid-view.mui-grid-9 {
  background-color: #fff;
  li.mui-table-view-cell {
    width: 33.3%;
    border: none;
    .mui-media-body {
      font-size: 13px;
    }
  }
  img {
    width: 60px;
    height: 60px;
  }
}

</style>
